$(function () {
    vm.getInfo();
});

var vm = new Vue({
    el: '#rrapp',
    data: {
        showList: true,
        title: null,
        projects: {}
    },

    methods: {
        getInfo: function (id) {
            $.get(baseURL + "ede/project/selectByMap", function (r) {
                vm.projects = r.list;
            });
        },
        del: function (id) {
            var pro = {
                id: id,
                delFlag: 0
            };
            layer.confirm('确定要删除？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                $.ajax({
                    type: "POST",
                    url: baseURL + "ede/project/update",
                    contentType: "application/json",
                    data: JSON.stringify(pro),
                    success: function (r) {
                        if (r.code == 0) {
                            layer.msg("删除成功", {icon: 1});
                            vm.getInfo();
                        } else {
                            layer.alert(r.msg);
                        }
                    }
                });
            });
        },

        toMyProject: function (id) {
            parent.vm.addTab("编辑工程","#modules/front/myproject.html?id="+id);
        },

        //导出工程id
        exportProject: function (id) {
            window.location.href = baseURL+"ede/project/export?id=" +id;
        },

    }
});